package io.ukoko.controller;

import io.ukoko.dto.Result;
import io.ukoko.service.CategoryService;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@CrossOrigin //跨域
@RestController
public class CategoryController
{
    @Resource
    private CategoryService categoryService;

    /**
     * 获取分类列表
     */
    @GetMapping(value = "/getCategoryList")
    public Result getCategoryList()
    {
        return Result.ok(categoryService.getCategoryList());
    }
}
